package overriden;

public class TestAnimals2 {
	public static void main (String [] args) {
		Animal2 a2 = new Horse2();
		a2.printYourself();
	}
}

class Animal2 {
	public void eat() {	}
	public void printYourself() {
		System.out.println("print from super class");
	}
}

class Horse2 extends Animal2 {
	public void printYourself() {
		super.printYourself(); //invoke the superclass (Animal2) code 
							   //then do Horse2-specific print work here
	}
}